import request from "../../src/utils/request";

//获取界面接口数据
export function getRolesAPI(params){
  return request({
    url: '/sys/role',
    method: 'GET',
    params
  })    
}
//获取公司信息
export function getCompanyInfoAPI(companyId) {
    return request({
      url: `/company/${companyId}`
    })
  }
 //新增角色
export function addRoleAPI(data) {
    return request({
      url: '/sys/role',
      method: 'post',
      data
    })
  }
  //获取某一个角色列表
  export function getRoleIdAPI(id) {
    return request({
      url: `/sys/role/${id}`
    })
  }
  //编辑角色
  export function updateRoleAPI(data) {
    return request({
      url: `/sys/role/${data.id}`,
      method: 'put',
      data
    })
  }
//删除角色
  export function deleteRoleAPI(id) {
    return request({
      url: `/sys/role/${id}`,
      method: 'delete'
    })
  }


  //给角色分配权限 保存权限
  export function assignPermAPI(data) {
    return request({
      url: '/sys/role/assignPrem',
      method: 'put',
      data
    })
  }